{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

<Hds::SideNav::Portal @ariaLabel="Policies Navigation Links" data-test-sidebar-nav-panel="Policies" as |Nav|>
  <Nav.BackLink
    @route="vault.cluster"
    @current-when={{false}}
    @icon="arrow-left"
    @text="Back to main navigation"
    data-test-sidebar-nav-link="Back to main navigation"
  />

  <Nav.Title data-test-sidebar-nav-heading="Policies">Policies</Nav.Title>

  {{#if (has-permission "policies" routeParams="acl")}}
    <Nav.Link
      @route="vault.cluster.policies"
      @model="acl"
      @current-when="vault.cluster.policies vault.cluster.policy"
      @text="ACL Policies"
      data-test-sidebar-nav-link="ACL Policies"
    />
  {{/if}}
  {{#if (and (has-feature "Sentinel") (has-permission "policies" routeParams="rgp"))}}
    <Nav.Link
      @route="vault.cluster.policies"
      @model="rgp"
      @current-when="vault.cluster.policies vault.cluster.policy"
      @text="Role-Governing Policies"
      data-test-sidebar-nav-link="Role-Governing Policies"
    />
  {{/if}}
  {{#if (and (has-feature "Sentinel") (has-permission "policies" routeParams="egp"))}}
    <Nav.Link
      @route="vault.cluster.policies"
      @model="egp"
      @current-when="vault.cluster.policies vault.cluster.policy"
      @text="Endpoint Governing Policies"
      data-test-sidebar-nav-link="Endpoint Governing Policies"
    />
  {{/if}}
</Hds::SideNav::Portal>